package com.tanhua.sso.vo;

import cn.hutool.core.convert.Convert;
import com.tanhua.sso.pojo.UserInfo;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class ManageUsersVo implements Serializable {
    private Integer id; //用户id
    private String nickname; //昵称
    private String avatar; //用户头像
    private String gender; //性别
    private Integer age; //年龄
    private String city; //城市
    private String userStatus;

    public static ManageUsersVo init(UserInfo userInfo){
        ManageUsersVo manageUsersVo=new ManageUsersVo();
        manageUsersVo.setAge(userInfo.getAge());
        manageUsersVo.setAvatar(userInfo.getAvatar());
        manageUsersVo.setCity(userInfo.getCity());
        manageUsersVo.setGender(userInfo.getGender());
        manageUsersVo.setUserStatus("1");
        manageUsersVo.setNickname(userInfo.getNickname());
        manageUsersVo.setId(Convert.toInt(userInfo.getId()));
        manageUsersVo.setUserStatus(userInfo.getUserStatus());
        return manageUsersVo;
    }
}
